public class QuantityController {
    public static void changePartQuantity(List<Shipment_Item__c> newShipmet_Items){
        //Part ID, Item수량
        Set<ID> partIds = new Set<ID>();
        Decimal sumSiQty = 0;
        for (Shipment_Item__c shipment_item : newShipmet_Items) {
          partIds.add(shipment_item.Part__c);
          //to-do:1개의 Part에 대한 1개의 Item이기때문에 유효.
          sumSiQty = sumSiQty + shipment_item.Quantity__c;
        }
        //Part List
        List<Part__c> parts = [SELECT Id, Quantity__c
          FROM Part__c
          WHERE Id IN :partIds ];
          
        //Update Part Quantity
        for (Part__c part : parts) {
          part.Quantity__c = part.Quantity__c - sumSiQty;
          update part;
        }
    }
}